package query

import (
	"jlpay-sdk-go/pkg/jlpay/core"
	"jlpay-sdk-go/pkg/jlpay/models/openmerch/query"
	"jlpay-sdk-go/pkg/jlpay/services"
)

// QueryService 查询服务
type QueryService struct {
	*services.BaseService
}

// NewQueryService 创建查询服务实例
func NewQueryService(config *core.Config) *QueryService {
	return &QueryService{
		BaseService: services.NewBaseService(config),
	}
}

// QueryMerchBaseInfo 查询商户基本信息
func (s *QueryService) QueryMerchBaseInfo(request *query.MerchBaseInfoQueryRequest) (*query.MerchBaseInfoQueryResponse, error) {
	response := query.NewMerchBaseInfoQueryResponse()
	err := s.Post(request, response, "/open/merch/access/merch-base-info/query")
	return response, err
}

// QueryMerchFee 查询商户费率
func (s *QueryService) QueryMerchFee(request *query.MerchFeeQueryRequest) (*query.MerchFeeQueryResponse, error) {
	response := query.NewMerchFeeQueryResponse()
	err := s.Post(request, response, "/open/merch/access/merch-rate-info/query")
	return response, err
}

// QueryMerchChannelInfo 查询商户渠道信息
func (s *QueryService) QueryMerchChannelInfo(request *query.MerchChannelInfoQueryRequest) (*query.MerchChannelInfoQueryResponse, error) {
	response := query.NewMerchChannelInfoQueryResponse()
	err := s.Post(request, response, "/open/merch/access/merch-channel-info/query")
	return response, err
}

// QueryMerchMasterSettCard 查询商户主结算卡
func (s *QueryService) QueryMerchMasterSettCard(request *query.MerchMasterSettCardQueryRequest) (*query.MerchMasterSettCardQueryResponse, error) {
	response := query.NewMerchMasterSettCardQueryResponse()
	err := s.Post(request, response, "/open/merch/access/merch-settle-info/query")
	return response, err
}
